﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ZXCompany.Models.Entity.ZX_LeaveMassage>" %>
<%@ Import Namespace="ZXCompany.DBUtil" %>
<%@ Import Namespace="ZXCompany.Models.Entity" %>
<%@ Import Namespace="System.Collections.Generic" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h2>在线留言</h2>
    <%   
        string HomeAction = Request.QueryString["action"] == null ? "" : Request.QueryString["action"].ToString();
        if (HomeAction != "add")
        { 
    %>
    <div style="width:100%;" class="tabtitle" >
	    <ul id="mytab1">
		    <li class="active">在线留言管理</li>
		    <li class="normal">在线留言编辑</li>
	    </ul>
    </div>
    <div style="width:100%;">
	    <table style="text-align:center;">
            <tr class="tdodd">
                <th style="background: none repeat scroll 0% 0% rgb(102, 187, 255);" colspan="9"></th>
            </tr>
            <%--姓名 联系方式 公司名称 留言内容 是否已读--%>
            <tr style=" height:20px;background: #eeeeff;"><td colspan="7"></td></tr>
            <tr style="background:#8899cc; font-size:14px;">
                <td style="background: #eeeeff; width:5%"></td>
                <td style="width:5%; font-weight:bold; ">序号</td>
                <td style="width:10%; font-weight:bold; ">姓名</td>
                <td style="width:10%;font-weight:bold;">联系方式</td>
                <td style="width:30%;font-weight:bold;">公司名称</td>
                <td style="width:15%;font-weight:bold;">留言内容</td>
                <td style="width:5%;font-weight:bold;">是否已读</td>
                <td style="width:10%;"></td>
                <td style="background: #eeeeff; width:5%"></td>
            </tr>
            <%     
                IList<ZX_LeaveMassage> HPImageList = ViewData["Account_ExpertType"] as IList<ZX_LeaveMassage>;
                for (int i = 0; i < HPImageList.Count; i++)
                {
            %>
            <tr style="background: #fff;"> 
                <td style="background: #eeeeff; width:5%"></td>
  	            <td ><% =i +1 %></td>
                <td ><%=HPImageList[i].lname %></td>
                <td ><%=HPImageList[i].contact %></td>
                <td ><%=HPImageList[i].companyName %></td>
                <td style=" text-align:left;"><% =HPImageList[i].message %></td>
                <td ><% = HPImageList[i].isRead=="1"?"是":"否" %></td>
                <td style="color:#00f">
                    <a href="LeaveMassage.aspx?action=add&hp_id=<%=HPImageList[i].ID %>">编辑</a> |
                    <a href="LeaveMassage.aspx?action=del&hp_id=<%=HPImageList[i].ID %>" onclick="if(!confirm('确定删除该在线留言么？'))return false;">
                    删除</a> 
                </td>
                <td style="background: #eeeeff; width:5%"></td>
            </tr>
            <%   
                }      
            %>
        </table>
    </div>
    <%
    }
    else
    { 
    %>
    <form action="<%=VirtualPath.getVirtualPath()%>/Account/LeaveMassage_Edit.aspx" method="post" id="Form1" name="LeaveMassage_Edit">  
    <div style="width:100%;" class="tabtitle" >
	    <ul id="Ul1">
		    <li class="normal" onclick="javascript:window.location.href = 'LeaveMassage';">在线留言管理</li>
		    <li class="active">在线留言编辑</li>
	    </ul>
    </div>
    <div style="width:100%;">
	    <table style ="border:1 solid #999999; width:100%" >
            <tr class="tdodd">
                <th style="background: none repeat scroll 0% 0% rgb(102, 187, 255);" colspan="4"></th>
            </tr>
            <tr><td style="background: #eeeeff; height:20px;" colspan="4"></td></tr>
            <%--姓名 联系方式 公司名称 留言内容 是否已读--%>
	        <tr>
                <td style="background: #eeeeff; width:10%"></td>
                <td style=" text-align:center; width:120px; height:40px;">姓名：</td>
                <td align="left"> 
                    <label style="padding: 20px; width: 450px;" id="lname"><% =Model.lname %> </label>
                    <%--<input class="input_out" style="padding: 2px; width: 450px;" 
                            value="<% =Model.lname %>" name="lname" size="40" type="text"/>--%>
	            </td>
                <td style="background: #eeeeff; width:10%"></td>
            </tr>
	        <tr>
                <td style="background: #eeeeff; width:10%"></td>
                <td style=" text-align:center; height:40px;">联系方式：</td>
                <td align="left"> 
                    <label style="padding: 20px; width: 450px;" id="contact"><% =Model.contact%> </label>
	            </td>
                <td style="background: #eeeeff; width:10%"></td>
            </tr>
	        <tr>
                <td style="background: #eeeeff; width:10%"></td>
                <td style=" text-align:center; height:40px;">公司名称：</td>
                <td align="left"> 
                    <label style="padding: 20px; width: 450px;" id="companyName"><% =Model.companyName%> </label>
	            </td>
                <td style="background: #eeeeff; width:10%"></td>
            </tr>
	        <tr>
                <td style="background: #eeeeff; width:10%"></td>
                <td style=" text-align:center; height:40px;">留言内容：</td>
                <td align="left"> 
                    <label style="padding: 20px; width: 450px;" id="message"><% =Model.message%> </label>
	            </td>
                <td style="background: #eeeeff; width:10%"></td>
            </tr>
	        <tr>
                <td style="background: #eeeeff; width:10%"></td>
                <td style=" text-align:center; height:40px;">是否已读：</td>
                <td align="left"> 
                    <label style="padding: 20px; width: 450px;" id="<% =Model.isRead == "1" ? "是" : "否"%>"><% =Model.isRead == "1" ? "是" : "否"%> </label>
	            </td>
                <td style="background: #eeeeff; width:10%"></td>
            </tr>
            <tr>
                <td style="background: #eeeeff; width:10%"></td>
                <td></td>
                <td style=" text-align:center; height:40px;">
                    <% if (Model.isRead != "1")
                        {
                    %>
                        <input type="submit" id="infoSave" value="确认已读" class="input2"/>
                    <% }%>
                    <input type="hidden" value="<% =Model.ID %>" name="ID" id="ID"/>
                </td>
                <td style="background: #eeeeff; width:10%"></td>
            </tr>
            <tr><td style="background: #eeeeff; height:20px;" colspan="4"></td></tr>
        </table>
    </div>
    </form>    
    <%
    }
    %>
</asp:Content>

<%--    <div style="margin:0 auto; width:100% ;text-align:center;"> 
        <table width ="90%" style=" height:100%;">
            <tr style="background:#6677AA;">
                <td style="width:10%; font-weight:bold; font-size:14px;">姓名</td>
                <td style="width:12%;font-weight:bold; font-size:14px;"">联系方式</td>
                <td style="width:10%;font-weight:bold; font-size:14px;"">公司名称</td>
                <td style="width:50%;font-weight:bold; font-size:14px;"">留言内容</td>
                <td style="width:10%;font-weight:bold; font-size:14px;"">是否已读</td>
                <td></td>
            </tr>
            <tr>
                <td>张某</td>
                <td>nx@sohu.com</td>
                <td>张氏有限</td>
                <td>应聘首席执行顾问</td>
                <td>NO</td>
                <td style="text-align:left"><input type="button" id="Button1" value="编辑" /><input type="button" id="Button2" value="删除" />
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td style="text-align:left">
                    <input type="button" id="infoSave" value="添加" class="input2" />
                </td>
            </tr>
        </table>
    </div>
--%>